<?php
declare(strict_types=1);
namespace Field;

class StoreProductVerLogConst
{
    public const pk='VerLogID';
    public const index=['VerLogID'];
	public const fields=['VerLogID','ProductID','CreateAt','UpdateAt','Content'];
	public const comment=['VerLogID'=>'属性ID','ProductID'=>'文件名','CreateAt'=>'录入时间','UpdateAt'=>'更新时间','Content'=>'内容'];
	/*
    * @Field VerLogID
    * @Type int(10) unsigned
    * @Collation 
    * @Null NO
    * @Key PRI
    * @Default 
    * @Extra auto_increment
    * @Privileges select,insert,update,references
    * @Comment 属性ID
    */
    public const VerLogID = 'VerLogID';
    /*
    * @Field ProductID
    * @Type int(10)
    * @Collation 
    * @Null YES
    * @Key MUL
    * @Default 0
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 文件名
    */
    public const ProductID = 'ProductID';
    /*
    * @Field CreateAt
    * @Type int(11)
    * @Collation 
    * @Null YES
    * @Key 
    * @Default 0
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 录入时间
    */
    public const CreateAt = 'CreateAt';
    /*
    * @Field UpdateAt
    * @Type int(11)
    * @Collation 
    * @Null YES
    * @Key 
    * @Default 0
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 更新时间
    */
    public const UpdateAt = 'UpdateAt';
    /*
    * @Field Content
    * @Type varchar(2000)
    * @Collation utf8mb4_general_ci
    * @Null YES
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 内容
    */
    public const Content = 'Content';
}

class StoreProductVerLogColumns
{
public  int $VerLogID;
   public  int $ProductID=0;
   public  int $CreateAt=0;
   public  int $UpdateAt=0;
   public  ?string $Content='';
	public function toArray():array
	{
		return [
'VerLogID'=>$this->VerLogID,
    'ProductID'=>$this->ProductID,
    'CreateAt'=>$this->CreateAt,
    'UpdateAt'=>$this->UpdateAt,
    'Content'=>$this->Content,        ];
	}
}

class StoreProductVerLogRow
{
	public StoreProductVerLogColumns $data;
	public function toArray():array
	{
		return $this->data->toArray();
    }

    public function getValue(string $field):string|int|null
    {
        return match ($field){
        'VerLogID' => $this->data->VerLogID,
        'ProductID' => $this->data->ProductID,
        'CreateAt' => $this->data->CreateAt,
        'UpdateAt' => $this->data->UpdateAt,
        'Content' => $this->data->Content, default=>null
        };
    }

    public function __construct(array $data)
    {
        $this->data = new StoreProductVerLogColumns();
        isset($data['VerLogID']) && $this->data->VerLogID = (int)$data['VerLogID'];
           isset($data['ProductID']) && $this->data->ProductID = (int)$data['ProductID'];
           isset($data['CreateAt']) && $this->data->CreateAt = (int)$data['CreateAt'];
           isset($data['UpdateAt']) && $this->data->UpdateAt = (int)$data['UpdateAt'];
           isset($data['Content']) && $this->data->Content = (string)$data['Content'];
    }
}
?>